<extend name="Public/base" />

<block name="style">

</block>

<block name="body">
    <!-- 弹窗插件 -->
    <include file="Public:artdialog" />

    <div class="row">
        <div class="col-md-12">
            <div class="block-web">
                <!-- 商品列表 -->
                    <div class="bgmain">
                        <div class="header">
                           <h3 class="content-header">添加</h3>
                        </div>
                    </div>
                <div id="load_tb_div" style="padding:10px 0px 30px ;">
<form action="__URL__/edit" method="post">                    
        <table class="table table-striped goods_list_table   table-bordered">
                <tr >
                       <th>邮件地址</th>
                       <th><input style="width:800px"  type="text" name="mailing_address" value="{$email.mailing_address}"/></th>
                </tr> 
                <tr >
                       <th>邮件名称</th>
                       <th><input  type="text" name="mail_name" value="{$email.mail_name}"/></th>
                </tr>
                <tr >
                       <th>是否有效</th>
                       <th><select name="isactive" field = "{$email.isactive}">
                       <option value='0'>无效</option>
                       <option value="1">有效</option>
                       </select></th>
                </tr>
                <tr >
                       <th>是否收件人</th>
                       <th><select name="isrecipient" field = "{$email.isrecipient}">
                       <option value='0'>无效</option>
                       <option value="1">有效</option>
                       </select></th>
                </tr>
				 <tr >
                       <th>收件邮件类型</th>
                       <td>
					   <div class="type" field="{$email.type}">
					  <label class="checkbox-inline">
						<input type="checkbox" id="inlineCheckbox1" name="types[]" value="采购需求"  style="margin-left:-20px;">采购需求
					  </label>
					  <label class="checkbox-inline">
						<input type="checkbox" id="inlineCheckbox2" name="types[]" value="51m团购预售" style="margin-left:-20px;">51m团购预售
					  </label>
					  </div>
					  </td>
                </tr>
                <tr >
                   <th><button type="submit"  class="btn btn-primary">提交</button></th>
                   <input type="hidden" name="email_id" value="{$email.email_id}"/>
                   <th><a href="__URL__/email"><button type="button" class="btn btn-success" id="addnew">返回</button></a></th>
                </tr>
        </table>
</form>  
</block>
<block name="script">
    <script type="text/javascript">
 
$(function(){
    $("select[name='isactive']").val($("select[name='isactive']").attr("field"));
});
$(function(){
    $("select[name='isrecipient']").val($("select[name='isrecipient']").attr("field"));
});
$(function(){
   var type = $(".type").attr("field");
   var tempStr = "采购需求";
   var tempStrm = "51";
   if(type.indexOf(tempStr) > -1)
   {    
       $("#inlineCheckbox1").attr('checked','checked');
   }
    if(type.indexOf(tempStrm) > -1)
   {    
       $("#inlineCheckbox2").attr('checked','checked');
   }
});
</script>
</block>